Skip to content

Refactor to generate Cartesian product instead of permutations#2

Merged
djeada merged 1 commit intomasterfrom
djeada-patch-2
Sep 16, 2025
Merged

Refactor to generate Cartesian product instead of permutations#2
djeada merged 1 commit intomasterfrom
djeada-patch-2

Conversation

@djeada
Copy link
Owner

@djeada djeada commented Sep 16, 2025

No description provided.

@djeada djeada requested a review from Copilot September 16, 2025 20:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the permutations algorithm to correctly implement a Cartesian product generator instead. The change addresses a conceptual error where the original code was mislabeled as generating "permutations" when it actually produced Cartesian products.

Key changes:

  • Renamed file from permutations.cpp to cartesian_product.cpp
  • Updated data structures from std::set<int> to std::vector<int> to maintain order in tuples
  • Corrected terminology and documentation to reflect Cartesian product generation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/1_Arrays/permutations.cpp Removed the incorrectly named permutations implementation
src/1_Arrays/cartesian_product.cpp Added properly named Cartesian product implementation with ordered tuples

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@djeada djeada merged commit 6e370a4 into master Sep 16, 2025
2 checks passed
@djeada djeada deleted the djeada-patch-2 branch September 20, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant